export default function(sequelize, DataTypes) {
  return sequelize.define('update_msg_history', {
    _session_id: {
      type: DataTypes.STRING(200),
      allowNull: false,
      comment: "会话id"
    },
    _update_time: {
      type: DataTypes.STRING(15),
      allowNull: false,
      primaryKey: true,
      comment: "更新的时间戳"
    },
    _manager_account: {
      type: DataTypes.STRING(15),
      allowNull: false,
      primaryKey: true,
      comment: "更新数据的管理员"
    },
    _update_attr: {
      type: DataTypes.STRING(15),
      allowNull: false,
      comment: "修改字段"
    },
    _update_to: {
      type: DataTypes.STRING(5000),
      allowNull: false,
      comment: "修改结果"
    },
    _update_from: {
      type: DataTypes.STRING(5000),
      allowNull: true,
      comment: "修改原值"
    }
  }, {
    sequelize,
    tableName: 'update_msg_history',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "_update_time" },
          { name: "_manager_account" },
        ]
      },
    ]
  });
};
